from django.db import models
class Register(models.Model):
    name = models.CharField(max_length=100)
    password = models.CharField(max_length=100)
class Persondata(models.Model):
    register = models.ForeignKey(Register,on_delete = models.CASCADE)  #外键关联
    name = models.CharField(max_length=100)
    sex = models.CharField(max_length=50)
    age = models.IntegerField()
    date = models.DateField()
    insteret = models.CharField(max_length=200)
class Adress(models.Model):
    register = models.ForeignKey(Register,on_delete=models.CASCADE)
    name = models.CharField(max_length=100)
    adress = models.CharField(max_length=100)
    phone = models.CharField(max_length=100)
    email = models.CharField(max_length=100)
class Cart(models.Model):
    register = models.ForeignKey(Register, on_delete=models.CASCADE)
    image = models.ImageField(upload_to="img")
    name = models.CharField(max_length=200)
    price = models.FloatField()
    desc = models.FloatField(max_length=300)
class Cart1(models.Model):
    register = models.ForeignKey(Register, on_delete=models.CASCADE)
    image = models.ImageField(upload_to="img")
    name = models.CharField(max_length=200)
    price = models.FloatField()
    desc = models.CharField(max_length=300)

class All_Shopping(models.Model):
    image = models.ImageField(upload_to="img")
    name = models.CharField(max_length=200)
    price = models.FloatField()
    desc = models.CharField(max_length=300)